package com.example.demo.config;

import com.example.demo.service.ImageGenerationService;
import com.example.demo.service.impl.ImageGenerationServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ImageGenerationConfig {
    
    @Value("${langchain4j.community.dashscope.chat-model.api-key}")
    private String apiKey;
    
    @Value("https://dashscope.aliyuncs.com/api/v1")
    private String baseUrl;
    
    @Bean
    public ImageGenerationService imageGenerationService() {
        return new ImageGenerationServiceImpl(apiKey, baseUrl);
    }
}